*** Settings ***
Documentation    TC09-Round Management LCL-Lock Unlock
Resource    ../../Keywords/Common_Head.robot
Force Tags    P3
Metadata    Author    Fiona
Metadata    ID    6857845
*** Variables ***
${user_wendy}    xpath= //div[@data-model='availableItems']//ul//li//b[.='Wendy Jiang (WENDJIAN)']

*** Test Cases ***
TC09-Round Management LCL-Lock Unlock
    Step 1 User Goes To Basic Data Management Tender List
    Step 2 User Goes To Pricing Collaboration Pricing Project
    Step 3 User Selects Row That Project Name Is 20240815 LCL
    Step 4 Select Current Project In Pricing Project Click On
    Step 5 User Clicks Next Round Management Button
    Step 6 Exchange To Role Project Owner Click On Lock Button
    Step 7 Select Current Role As Project Owner
    Step 8 Exchange Role To Country Pricing Manager DE
    Step 9 Exchange Role To Country Pricing Manager DE CN N AU US
    Step 10 Exchange The Role To Cluster Head GREATER CHINA AU NZ
    Step 11 Close This Pop up Dialog Click On Unlock Button
    Step 12 Close This Pop up Dialog
    Step 13 Exchange The Role To Region Pricing Manager EUROPE NAM
    Step 14 Close This Pop up Dialog Click On Unlock Button 2
    Step 15 Close This Pop up Dialog 2
    Step 16 Exchange The Role To Project Owner
    Step 17 Select All
    Step 18 Close The Dialog Check The Dropdown List Of Current
    Step 19 Exchange The Role To Region Pricing Manager EUROPE NAM 2
    Step 20 Select All 2
    Step 21 Close The Dialog Check The Dropdown List Of Current 2
    Step 22 Exchange To Any Of The Role
    Step 23 Exchange Current Role To Project Owner 2
    Step 24 Click On Close Button
    Step 25 Select This Project Click On Delete Project Button
    Step 26 User Goes To Basic Data Management Tender List 2
 


*** Keywords ***
Step ${step} User Goes To Basic Data Management Tender List
    #************************Step 1******************************
    #  Do:
    #      User goes to Basic Data Management Tender List
    #      Click Create button
    #      Input with following attributes
    #      Tender ID some numbers such as 202408151435001 you can
    #     input with current datetime and some random number to
    #     avoid duplicate validation
    #      Tender Title some value such as Regression Test by
    #     Wendy001
    #      Customer 815 Miele
    #      Mode select all
    #      Level Global
    #      Click on Save button
    #  Expected:
    #      Created successfully with the message Tender has been
    #     added
    #************************************************************
    ${G_TENDERID}    Generate Tender ID
    Set Suite Variable     ${G_TENDERID}
    Login Space
    Create Tender    ${G_TENDERID}    Regress    815    true    true    true

Step ${step} User Goes To Pricing Collaboration Pricing Project
    #************************Step 2******************************
    #  Do:
    #      User goes to Pricing Collaboration Pricing Project
    #      User clicks Create Project button
    #      Input following attributes
    #      Tender ID 20240815 Regression
    #      Mode LCL
    #      Deadline to TM current date 10 day
    #      Rate Validity From current date
    #      Rate Validity To current date 100 day
    #      Deputies NATZHANG
    #      Description for regression
    #      Click on Save button
    #  Expected:
    #      A new project is created successfully
    #************************************************************
    ${ValidFrom}    Get Current Date    result_format=%d/%m/%Y
    Set Test Variable    ${ValidFrom}    ${ValidFrom}
    ${DeadLine}    Get Current Date    UTC    +10days    result_format=%d/%m/%Y
    ${ValidTo}    Get Current Date    UTC    +100days    result_format=%d/%m/%Y
    ${PROJECT}    Copy Dictionary    ${PROJECT_PARAM}
    Set To Dictionary    ${PROJECT}    
    ...    TENDER_ID=${G_TENDERID}    TENDER_TITLE=Regress    CUSTOEMR_NAME=Miele    CUSTOMER_LEVEL=Global
    ...   MODE=LCL    DEADLINE_TM_DATE=${DeadLine}    VALID_FROM=${ValidFrom}    VALID_TO=${ValidTo}    DEPUTY=NATZHANG
    Set Test Variable    ${PROJECT}    ${PROJECT}
    Create Project    ${PROJECT}

Step ${step} User Selects Row That Project Name Is 20240815 LCL
    #************************Step 3******************************
    #  Do:
    #      User selects row that project name is 20240815 LCL
    #     Regression
    #      Click on Copy Data
    #      In the pop up dialog input Tender ID with value
    #     2024000001 click on Search button
    #      Select this entry click on Copy Data button and Yes in
    #     pop up window
    #  Expected:
    #      Successfully with messages in pop up window
    #      Tender has been successfully copied from 2024000001 LCL
    #     do not touch me
    #      Please adjust the template and the lanes in Template
    #     Lane Management page if required
    #      After click on OK button
    #      The same message is displayed in Pricing Project page
    #     too
    #************************************************************
    Search Project    ${PROJECT.TENDER_ID}  
    Copy Data    2024000001    LCL    do not touch me

Step ${step} Select Current Project In Pricing Project Click On
    #************************Step 4******************************
    #  Do:
    #      Select current project in pricing project click on
    #     template management button
    #      Click Skip button in Step4 and Yes in the pop up
    #     windown
    #  Expected:
    #      Next Round Management button is enable
    #************************************************************
    Search Project    ${PROJECT.TENDER_ID}  
    Wait Until Search Finished
    Wait For Elements State    ${Project_toolbar_TemplateManagementButton}   enabled    20
    Click    ${Project_toolbar_TemplateManagementButton}
    click    ${Template_SkipSendToGPDButton}
    click    ${SkipSendToGPD_Yes}
    Wait For Elements State    css=[data-ng-click="go2NextStep()"]   enabled    20



Step ${step} User Clicks Next Round Management Button
    #************************Step 5******************************
    #  Do:
    #     User clicks Next: round management button.
    #     Set deadline of each region as current date, Assign WENDJIAN to each Region, start round, send notification.
    #     Set deadline of each cluster and country as current date, Assign WENDJIAN to each Cluster and Country / Trade lane, send notification.
    #     Reopen the round management window, check the dropdown list of current role.
    #  Expected:
    #      All of the country or trade lane and cluster are all
    #     display in the dropdown list with the background color
    #     yellow index php attachments get 2eab9e8a 03dd 40c2 bb20
    #     214eb1ba9f53
    #************************************************************
    click    css=[data-ng-click="go2NextStep()"]
    Wait Until Search Finished
    ${Date}    Get Current Date    UTC    result_format=%d/%m/%Y
    Input Deadline In Region Tab    0    0    ${Date}
    Input Deadline In Region Tab    0    1    ${Date}
    Input Deadline In Region Tab    1    0    ${Date}
    Wait Until Keyword Succeeds    5x    100ms    Click    ${Project_RoundMgmt_AssignButton}
    Round Mgmt Assign User    ${Project_RoundMgmt_Assign_ApacTab}    xpath=//div[@data-model='availableItems']//ul//li//b[.='Wendy Jiang (WENDJIAN)']
    Round Mgmt Assign User    ${Project_RoundMgmt_Assign_EuropeTab}    xpath=//div[@data-model='availableItems']//ul//li//b[.='Wendy Jiang (WENDJIAN)']
    Round Mgmt Assign User    ${Project_RoundMgmt_Assign_NamTab}    xpath=//div[@data-model='availableItems']//ul//li//b[.='Wendy Jiang (WENDJIAN)']
    click    ${Project_RoundMgmt_Assign_SaveButton} 
    click    ${Project_RoundMgmt_StartButton} 
    click    ${Project_RoundMgmt_StartConfirmButton}
    click    ${Project_RoundMgmt_Confirm_SendButton}
    click    ${Project_RoundMgmt_CloseButton}
    close browser
    Set Global Variable    ${USERNAME}    WENDJIAN
    Login Space
    Search Project    ${PROJECT.TENDER_ID}
    Wait Until Search Finished
    Wait Until Keyword Succeeds    10x    500ms    Click    ${Project_toolbar_RoundMgmtButton}
    Assign My Current Role    Regional Pricing Manager(EUROPE,NAM,APAC)

    Input Deadline In Country Tab    0    0    ${Date}
    Input Deadline In Country Tab    0    1    ${Date}
    Input Deadline In Country Tab    1    0    ${Date}
    Input Deadline In Country Tab    1    1    ${Date}
    Input Deadline In Country Tab    2    0    ${Date}
    Click    //a[.='Cluster']
    Input Deadline In Cluster Tab    0    0    ${Date}
    Input Deadline In Cluster Tab    0    1    ${Date}
    Input Deadline In Cluster Tab    1    0    ${Date}
  
    Wait Until Keyword Succeeds    5x    100ms    Click    ${Project_RoundMgmt_AssignButton}
    Round Mgmt Assign User    (//a[.='Country'])[1]    ${user_wendy}    //a[.='AU']    
    Round Mgmt Assign User    (//a[.='Country'])[1]    ${user_wendy}    //a[.='CN-C'] 
    Round Mgmt Assign User    (//a[.='Country'])[1]    ${user_wendy}    //a[.='DE'] 
    Round Mgmt Assign User    (//a[.='Country'])[1]    ${user_wendy}    //a[.='US']
    Round Mgmt Assign User    (//a[.='Country'])[1]    ${user_wendy}    (//a[.='US'])[2]
    Round Mgmt Assign User    (//a[.='Cluster'])[1]    xpath=//div[@data-model='availableItems']//ul//li//b[.='Wendy Jiang (WENDJIAN)']   //a[.='Australia & New Zealand']
    Round Mgmt Assign User    (//a[.='Cluster'])[1]    xpath=//div[@data-model='availableItems']//ul//li//b[.='Wendy Jiang (WENDJIAN)']      //a[.='Germany & Switzerland']
    Round Mgmt Assign User    (//a[.='Cluster'])[1]    xpath=//div[@data-model='availableItems']//ul//li//b[.='Wendy Jiang (WENDJIAN)']      //a[.='Greater China']
    Click    ${Project_RoundMgmt_Assign_SaveButton}
    Wait Until Search Finished
    click    ${Project_RoundMgmt_SendNotifButton}
    click    ${Project_RoundMgmt_Confirm_SendButton}
    Sleep    5
    click    ${Project_RoundMgmt_CloseButton}
    Search Project    ${PROJECT.TENDER_ID}
    Wait Until Search Finished
    Wait For Elements State    ${Project_toolbar_RoundMgmtButton}   enabled    20
    Click    ${Project_toolbar_RoundMgmtButton}
    Click    //div[@ng-click="toggleDropdown()"]
    Wait For Elements State     //div[contains(text(),'Regional Pricing Manager(EUROPE,NAM,APAC)')]    visible    20
    Sleep    3
    ${color2}    Get Attribute        //div[contains(text(),'Regional Pricing Manager(EUROPE)')]//span     style
    Should Contain    ${color2}     orange
    ${color3}    Get Attribute        //div[contains(text(),'Regional Pricing Manager(NAM)')]//span     style
    Should Contain    ${color3}     orange
    ${color4}    Get Attribute        //div[contains(text(),'Regional Pricing Manager(APAC)')]//span     style
    Should Contain    ${color4}     orange  
    ${color5}    Get Attribute        //div[contains(text(),'Cluster Head(GREATER CHINA)')]//span     style
    Should Contain    ${color5}     orange
    ${color6}    Get Attribute        //div[contains(text(),'Cluster Head(AU-NZ)')]//span     style
    Should Contain    ${color6}     orange
    ${color7}    Get Attribute        //div[contains(text(),'Cluster Head(DE-CH)')]//span     style
    Should Contain    ${color7}     orange 
    ${color8}    Get Attribute        //div[contains(text(),'Country Pricing Manager(DE)')]//span     style
    Should Contain    ${color8}     orange
    ${color9}    Get Attribute        //div[contains(text(),'Country Pricing Manager(CN-C)')]//span     style
    Should Contain    ${color9}     orange
    ${color10}    Get Attribute        //div[contains(text(),'Country Pricing Manager(AU)')]//span     style
    Should Contain    ${color10}     orange   
    ${color11}    Get Attribute        //div[contains(text(),'Country Pricing Manager(US)')]//span     style
    Should Contain    ${color11}     orange   

Step ${step} Exchange To Role Project Owner Click On Lock Button
    #************************Step 6******************************
    #  Do:
    #      Exchange to role Project Owner Click on Lock button
    #      Select EUROPE to lock
    #  Expected:
    #      Lock success
    #************************************************************
    Assign My Current Role    Project Owner

Step ${step} Select Current Role As Project Owner
    #************************Step 7******************************
    #  Do:
    #      Select current role as Project Owner
    #      Click on Lock button
    #      In the pop up window Select EUROPE to Lock
    #      Close this window
    #      Check the dropdown list of current role
    #      Check dashboard Region tab Country Cluster tab
    #  Expected:
    #      It displays as
    #      index php attachments get 082404d6 2b57 412c 9f2d
    #     da144e15e658
    #      index php attachments get bc655c63 386c 42d7 88a6
    #     eb4690478ddb index php attachments get a7cd8600 487c
    #     412e 8da7 4c86f8616bf0 index php attachments get
    #     b25d1190 f468 487e 84cf ed90ada3e49c
    #************************************************************
    click    ${Project_RoundMgmt_LockButton}
    click    //a[.='Region']
    click    //div[@class="tab-content"]//div[contains(text(),'EUROPE')]/..//input
    click    css=[data-ng-click="lock()"]
    click    css=[data-ng-click="$close()"]
    Click    //div[@ng-click="toggleDropdown()"]
    Wait For Elements State     //div[contains(text(),'Regional Pricing Manager(EUROPE)')]    visible    20
    Wait For Elements State    //td[.='DE']/following-sibling::td//div/span[.='1/1']    visible    timeout=10s
    Wait For Elements State    //td[.='DE']/following-sibling::td[.='Completed']    visible    timeout=10s
    Click    //a[.='Cluster']
    Wait For Elements State    //td[.='Germany & Switzerland']/following-sibling::td//div/span[.='1/1']    visible    timeout=10s
    Wait For Elements State    //td[.='Germany & Switzerland']/following-sibling::td[.='Completed']    visible    timeout=10s
    click    ${Project_RoundMgmt_CloseButton}
    
Step ${step} Exchange Role To Country Pricing Manager DE
    #************************Step 8******************************
    #  Do:
    #      Exchange role to Country Pricing Manager DE
    #  Expected:
    #      No submission button is displayed
    #************************************************************
    Search Project    ${PROJECT.TENDER_ID}
    Wait Until Search Finished
    Wait For Elements State    ${Project_toolbar_RoundMgmtButton}   enabled    20
    Click    ${Project_toolbar_RoundMgmtButton}
    Assign My Current Role    Country Pricing Manager(DE)
    ${color}    Get Attribute        //div[contains(text(),'Country Pricing Manager(DE)')]//span     style
    Should Contain    ${color}     green
    click    //div[contains(text(),'Country Pricing Manager(DE)')]
    Wait For Elements State     ${Project_RoundMgmt_SubmissionButton}   detached     20

Step ${step} Exchange Role To Country Pricing Manager DE CN N AU US
    #************************Step 9******************************
    #  Do:
    #      Exchange role to Country Pricing Manager DE CN N AU US
    #      Download IPT
    #      Submission upload the downloaded file submit If errors
    #     please update some wrong values as the error messages
    #     hint
    #      Check the dropdown list of current role
    #      Check the dashboard
    #  Expected:
    #      All the background color of countries are green And the
    #     status is complete
    #************************************************************
    Click    ${Project_RoundMgmt_CurrentRole}
    Sleep    2
    Assign My Current Role    Country Pricing Manager(DE,AU,CN-C,US)
    ${filename}    Download File    ${Project_RoundMgmt_DownloadButton}
    Wait Until Search Finished
    click    ${Project_RoundMgmt_SubmissionButton}
    Click    ${Project_RoundMgmt_Submit_SelectAll}
    click    ${Project_RoundMgmt_Submit_UploadButton}
    Wait For Elements State   ${upload_addFileButton}     enabled
    Upload File By Selector    ${upload_addFileButton}    ${filename}
    click    [data-ng-click="submitUploads()"]
    Wait For Elements State    //legend[.='Step 3: Submit Charges']/..//span[contains(text(),'SUCCESSFUL')]      visible    20  
    click    [data-ng-click="$close()"]   
    Click    //div[@ng-click="toggleDropdown()"]
    Wait For Elements State     //div[contains(text(),'Country Pricing Manager(US)')]    visible    20
    Sleep    3
    ${color2}    Get Attribute        //div[contains(text(),'Country Pricing Manager(DE)')]//span     style
    Should Contain    ${color2}     green
    ${color3}    Get Attribute        //div[contains(text(),'Country Pricing Manager(CN-C)')]//span     style
    Should Contain    ${color3}     green
    ${color4}    Get Attribute        //div[contains(text(),'Country Pricing Manager(AU)')]//span     style
    Should Contain    ${color4}     green

Step ${step} Exchange The Role To Cluster Head GREATER CHINA AU NZ
    #************************Step 10******************************
    #  Do:
    #      Exchange the role to Cluster Head GREATER CHINA AU NZ
    #     DE CH
    #      Click on Lock button
    #  Expected:
    #      In Country tab No countries listed here
    #      with the message Only unsubmitted countries will be
    #     listed here
    #************************************************************
    Wait For Elements State     //div[contains(text(),'Cluster Head(GREATER CHINA,AU-NZ,DE-CH)')]    visible    20
    click    //div[contains(text(),'Cluster Head(GREATER CHINA,AU-NZ,DE-CH)')]
    click    ${Project_RoundMgmt_LockButton}
    click    //a[.='Country']
    Wait For Elements State    //b[.='Only unsubmitted countries will be listed here.']    visible    20

Step ${step} Close This Pop up Dialog Click On Unlock Button
    #************************Step 11******************************
    #  Do:
    #      Close this pop up dialog click on Unlock button
    #  Expected:
    #      In Country tab no DE others are all listed
    #************************************************************
    click    [data-ng-click="$close()"]   
    click    ${Project_RoundMgmt_UnlockButton}
    Sleep    3
    click    //a[.='Country']
    Wait For Elements State    //label[contains(text(),'CN-C')]        visible    20
    Wait For Elements State    //label[contains(text(),'AU')]        visible    20

Step ${step} Close This Pop up Dialog
    #************************Step 12******************************
    #  Do:
    #      Close this pop up dialog
    #      Download IPT
    #      Submission upload the downloaded file submit If errors
    #     please update some wrong values as the error messages
    #     hint
    #      Check the dropdown list of current role
    #      Check the dashboard
    #  Expected:
    #      All the background color of clusters are green And the
    #     status is complete
    #************************************************************
    click    [data-ng-click="$close()"]   
    ${filename}    Download File    ${Project_RoundMgmt_DownloadButton}
    Wait Until Search Finished
    click    ${Project_RoundMgmt_SubmissionButton}
    click    css=[data-ng-change="selectAll(all)"]
    click    ${Project_RoundMgmt_Submit_UploadButton}
    Wait For Elements State   ${upload_addFileButton}     enabled
    Upload File By Selector    ${upload_addFileButton}    ${filename}
    click    [data-ng-click="submitUploads()"]
    Wait For Elements State    //legend[.='Step 3: Submit Charges']/..//span[contains(text(),'SUCCESSFUL')]      visible    20  
    click    [data-ng-click="$close()"]   
    Click    //div[@ng-click="toggleDropdown()"]
    Wait For Elements State     //div[contains(text(),'Country Pricing Manager(DE)')]    visible    20
    Sleep    3
    ${color2}    Get Attribute        //div[contains(text(),'Cluster Head(GREATER CHINA)')]//span     style
    Should Contain    ${color2}     green
    ${color3}    Get Attribute        //div[contains(text(),'Cluster Head(AU-NZ)')]//span     style
    Should Contain    ${color3}     green
    ${color4}    Get Attribute        //div[contains(text(),'Cluster Head(DE-CH)')]//span     style
    Should Contain    ${color4}     green


Step ${step} Exchange The Role To Region Pricing Manager EUROPE NAM
    #************************Step 13******************************
    #  Do:
    #      Exchange the role to Region Pricing Manager EUROPE NAM
    #     APAC
    #      Click on Lock button
    #  Expected:
    #      In Country tab No countries listed here
    #      with the message Only unsubmitted countries will be
    #     listed here
    #************************************************************
    Wait For Elements State     //div[contains(text(),'Regional Pricing Manager(EUROPE,NAM,APAC)')]    visible    20
    click    //div[contains(text(),'Regional Pricing Manager(EUROPE,NAM,APAC)')]
    click    ${Project_RoundMgmt_LockButton}
    click    //a[.='Country']
    Wait For Elements State    //b[.='Only unsubmitted countries will be listed here.']    visible    20



Step ${step} Close This Pop up Dialog Click On Unlock Button 2
    #************************Step 14******************************
    #  Do:
    #      Close this pop up dialog click on Unlock button
    #  Expected:
    #      In Country tab no DE others are all listed
    #************************************************************
    click    [data-ng-click="$close()"]   
    click    ${Project_RoundMgmt_UnlockButton}
    Sleep    3
    click    //a[.='Country']
    Wait For Elements State    //label[contains(text(),'CN-C')]        visible    20
    Wait For Elements State    //label[contains(text(),'US')]        visible    20
    Wait For Elements State    //label[contains(text(),'AU')]        visible    20

Step ${step} Close This Pop up Dialog 2
    #************************Step 15******************************
    #  Do:
    #      Close this pop up dialog
    #      Download IPT
    #      Submission upload the downloaded file submit
    #      Check the dropdown list of current role
    #      Check the dashboard
    #  Expected:
    #      All the background color of regions are green And the
    #     status is complete
    #************************************************************
    click    [data-ng-click="$close()"]   
    ${filename}    Download File    ${Project_RoundMgmt_DownloadButton}
    Wait Until Search Finished
    click    ${Project_RoundMgmt_SubmissionButton}
    click    css=[data-ng-change="selectAll(all)"]
    click    ${Project_RoundMgmt_Submit_UploadButton}
    Wait For Elements State   ${upload_addFileButton}     enabled
    Upload File By Selector    ${upload_addFileButton}    ${filename}
    click    [data-ng-click="submitUploads()"]
    Wait For Elements State    //legend[.='Step 3: Submit Charges']/..//span[contains(text(),'SUCCESSFUL')]      visible    20  
    click    [data-ng-click="$close()"]   
    Click    //div[@ng-click="toggleDropdown()"]
    Wait For Elements State     //div[contains(text(),'Regional Pricing Manager(EUROPE,NAM,APAC)')]    visible    20
    Sleep    3
    ${color2}    Get Attribute        //div[contains(text(),'Regional Pricing Manager(EUROPE)')]//span     style
    Should Contain    ${color2}     green
    ${color3}    Get Attribute        //div[contains(text(),'Regional Pricing Manager(NAM)')]//span     style
    Should Contain    ${color3}     green
    ${color4}    Get Attribute        //div[contains(text(),'Regional Pricing Manager(APAC)')]//span     style
    Should Contain    ${color4}     green

Step ${step} Exchange The Role To Project Owner
    #************************Step 16******************************
    #  Do:
    #      Exchange the role to Project Owner
    #      Click on Unlock button
    #  Expected:
    #      All the regions are listed here
    #************************************************************
    Click    //div[contains(text(),'Project Owner')]
    click    ${Project_RoundMgmt_UnlockButton}
    Sleep    3
    click    //a[.='Region']
    Wait For Elements State    //div[contains(text(),'APAC')]        visible    20
    Wait For Elements State    //div[contains(text(),'EUROPE')]        visible    20
    Wait For Elements State    //div[contains(text(),'NAM')]        visible    20

Step ${step} Select All
    #************************Step 17******************************
    #  Do:
    #      Select All
    #      Click on Unlock button
    #  Expected:
    #      Unlock success and all regions are removed from this
    #     page
    #************************************************************
    click    css=[data-ng-change="selectAll('region',lockAll.regionSelectAll)"]
    click    css=[data-ng-click="unlock()"]
    Wait For Elements State    //b[.='Only submitted region will list here.']    visible    20

Step ${step} Close The Dialog Check The Dropdown List Of Current
    #************************Step 18******************************
    #  Do:
    #      Close the dialog Check the dropdown list of current
    #     role
    #  Expected:
    #      All the background color of countries are yellow
    #************************************************************
    click    [data-ng-click="$close()"]   
    Click    //div[@ng-click="toggleDropdown()"]
    Wait For Elements State     //div[contains(text(),'Regional Pricing Manager(EUROPE,NAM,APAC)')]    visible    20
    Sleep    3
    ${color2}    Get Attribute        //div[contains(text(),'Regional Pricing Manager(EUROPE)')]//span     style
    Should Contain    ${color2}     orange
    ${color3}    Get Attribute        //div[contains(text(),'Regional Pricing Manager(NAM)')]//span     style
    Should Contain    ${color3}     orange
    ${color4}    Get Attribute        //div[contains(text(),'Regional Pricing Manager(APAC)')]//span     style
    Should Contain    ${color4}     orange  

Step ${step} Exchange The Role To Region Pricing Manager EUROPE NAM 2
    #************************Step 19******************************
    #  Do:
    #      Exchange the role to Region Pricing Manager EUROPE NAM
    #     APAC
    #      Click on UnLock button
    #  Expected:
    #      All countries are listed here
    #************************************************************
    click    //div[contains(text(),'Regional Pricing Manager(EUROPE,NAM,APAC)')]
    click    ${Project_RoundMgmt_UnlockButton}
    Sleep    3
    click    //a[.='Country']
    Wait For Elements State    //label[contains(text(),'AU')]        visible    20
    Wait For Elements State    //label[contains(text(),'CN-C')]        visible    20
    Wait For Elements State    //label[contains(text(),'DE')]        visible    20
    Wait For Elements State    //label[contains(text(),'US')]        visible    20

Step ${step} Select All 2
    #************************Step 20******************************
    #  Do:
    #      Select All
    #      Click Unlock button
    #  Expected:
    #      Unlock success
    #************************************************************
    click    css=[data-ng-change="selectAll('country',lockAll.countrySelectAll)"]
    click    css=[data-ng-click="unlock()"]
    Wait For Elements State    //b[.='Only submitted country will list here.']    visible    20

Step ${step} Close The Dialog Check The Dropdown List Of Current 2
    #************************Step 21******************************
    #  Do:
    #      Close the dialog check the dropdown list of Current
    #     Role
    #  Expected:
    #      All the background color are yellow
    #************************************************************
    click    [data-ng-click="$close()"]   
    Click    //div[@ng-click="toggleDropdown()"]
    Wait For Elements State     //div[contains(text(),'Cluster Head(GREATER CHINA,AU-NZ,DE-CH)')]    visible    20
    Sleep    3
    ${color2}    Get Attribute        //div[contains(text(),'Cluster Head(GREATER CHINA)')]//span     style
    Should Contain    ${color2}     orange
    ${color3}    Get Attribute        //div[contains(text(),'Cluster Head(AU-NZ)')]//span     style
    Should Contain    ${color3}     orange
    ${color4}    Get Attribute        //div[contains(text(),'Cluster Head(DE-CH)')]//span     style
    Should Contain    ${color4}     orange   
    ${color5}    Get Attribute        //div[contains(text(),'Country Pricing Manager(DE)')]//span     style
    Should Contain    ${color5}     orange
    ${color6}    Get Attribute        //div[contains(text(),'Country Pricing Manager(CN-C)')]//span     style
    Should Contain    ${color6}     orange
    ${color7}    Get Attribute        //div[contains(text(),'Country Pricing Manager(AU)')]//span     style
    Should Contain    ${color7}     orange   
    ${color8}    Get Attribute        //div[contains(text(),'Country Pricing Manager(US)')]//span     style
    Should Contain    ${color8}     orange      


Step ${step} Exchange To Any Of The Role
    #************************Step 22******************************
    #  Do:
    #      Exchange to any of the role
    #  Expected:
    #      The Submission button is enable
    #************************************************************
    click    //div[contains(text(),'Regional Pricing Manager(EUROPE,NAM,APAC)')]
    Wait For Elements State     ${Project_RoundMgmt_SubmissionButton}   enabled     20

Step ${step} Exchange Current Role To Project Owner 2
    #************************Step 23******************************
    #  Do:
    #      Exchange current role to Project Owner
    #      Click on Close Round button
    #      In pop up dialog
    #      Select Send notification to all pricing manager
    #      User clicks yes button
    #  Expected:
    #      1 A prompt says Close Success
    #      2 Current Pricing Round 1 Closed 2 lanes
    #      3 There have new round button and reopen round button
    #************************************************************
    Assign My Current Role    Project Owner
    click    ${Project_RoundMgmt_CloseRoundButton}
    click    //span[.='Send notification to all pricing manager.']
    click    ${Project_RoundMgmt_StartConfirmButton} 
    Wait For Elements State    //span[.='Close Success']    visible    20
    Wait For Elements State    //span[.='1 (Closed) 2 lanes']    visible    20
    Wait For Elements State    css=[data-ng-click="newRound()"]    visible    20
    Wait For Elements State    css=[data-ng-click="reopenRound()"]    visible    20

Step ${step} Click On Close Button
    #************************Step 24******************************
    #  Do:
    #      Click on Close button
    #      In Pricing Project page User selects TenderID Contains
    #     20240815
    #  Expected:
    #      The project with LCL mode could be found
    #************************************************************
    Click    ${Project_RoundMgmt_CloseButton}  
    Wait For Elements State    //td[contains(text(),'${G_TENDERID}')]    visible    20
    close browser
    Set Global Variable    ${USERNAME}    AUTOTEST
    Login Space
    Click DataClean For Delete
Step ${step} Select This Project Click On Delete Project Button
    #************************Step 25******************************
    #  Do:
    #      Select this project click on Delete Project button
    #      Click Yes of the pop up confirm window
    #      If Delete Project button is disable do Data Cleaning
    #     and cancel first and then Delete Project button is
    #     enable
    #  Expected:
    #      System displays Project has been deleted
    #************************************************************
    LOG    Done in teardown

Step ${step} User Goes To Basic Data Management Tender List 2
    #************************Step 26******************************
    #  Do:
    #      User goes to Basic Data Management Tender List
    #      Search out the tender created in step1
    #      Click on Delete button
    #      Click on Yes button in the popup dialog
    #  Expected:
    #      System displays Tender has been deleted
    #************************************************************
    LOG    Done in teardown

